var express = require('express');
var router = express.Router();

const {
  signup,
  list,
  remove,
  signin,
  signout,
  isAuth,
  token
} = require('../controllers/users');

//引入中间件
const {
  auth
} = require('../middlewares/auth');

/* GET users listing. */
//注册用户
router.post('/', auth, signup);
//用户列表 auth中间件拦截
router.get('/', auth, list);
//删除用户
router.delete('/', auth, remove);
//登录
router.post('/signin', signin);
//登出
router.get('/signout', auth, signout);
//是否具有权限
router.get('/isAuth', isAuth);
//token
router.get('/api/token', token);





module.exports = router;